<template>
	<view class="loginpage">
     <image class="bg" src="/static/imgs/群组 45@1x (1).png" mode="">
		
	 </image>
	 <view class="logobox">
	 	<image class="logo" src="/static/imgs/群组 46@1x.png" mode=""></image>
		<button class="btn" @click="handlogin">
			授权登录
		</button>
		<view class="xieyiline">
			<view class="nocheck" v-if="!isread" @click="isread=true">
				
			</view>
			<view class="check"v-if="isread" @click="isread=false">
				<view class="yuan">
					
				</view>
			</view>
			<view class="title">
				我已阅读并同意
			</view>
			<view class="xieyi" @click="userxieyi">
			   《用户使用协议》
			</view>
			<view class="title">
				和
			</view>
			<view class="xieyi" @click="yinsixieyi">
			   《隐私政策》
			</view>
			
		</view>
	 </view>
	</view>
</template>

<script>
	// import {login} from '../../../teabar/utils/api.js'
	export default {
		data() {
			return {
				isread:false
			}
		},
     mounted(){
		// uni.clearStorageSync()
	 },
	
		methods: {
			// handlogin(){
			// 	uni.switchTab({
			// 		url:'/pages/index/index'
			// 	})
			// },
		handlogin(){
		
			if(this.isread){
				 let redirect_uri = encodeURIComponent('https://mallsystem.dianjingkeji.net/pages/next/next')
				    let url = 'https://open.weixin.qq.com/connect/oauth2/authorize'
				    let appid = 'wx90272f8ac1742696'
			 window.location.href = `${url}?appid=${appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
		
			 
			}else{
				uni.showToast({
					title: '请阅读用户隐私协议',
					icon:'none',
					duration: 2000
				});
			}
			
		},
	
			userxieyi(){
				uni.navigateTo({
					url:'/pages/userxieyi/userxieyi'
				})
			},
			yinsixieyi(){
				uni.navigateTo({
					url:'/pages/yinsi/yinsi'
				})
			},
		}
	}
</script>

<style lang="less" scoped>
.loginpage{
	width: 750rpx;
	height:94vh;
	.bg{
		width: 100%;
		height: 100%;
	}
	.logobox{
		width: 100%;
		height: 50vh;
		position: absolute;
		top: 20vh;
		left: 0;
		.logo{
			width: 180rpx;
			height: 180rpx;
			margin: 0 285rpx;
		}
		.btn{
			
			width: 650rpx;
			height: 90rpx;
			margin: 5vh auto;
			text-align: center;
			color: white;
			border-radius: 45rpx;
			line-height: 90rpx;
			background: #3B89F3;
		}
		.xieyiline{
			margin: 5vh auto;
			width: 700rpx;
			display: flex;
			align-items: center;
			font-size: 25rpx;
			justify-content: center;
			.nocheck{
				height: 30rpx;
				width: 30rpx;
				border: 1rpx solid gray;
				border-radius: 50%;
				margin: 0 5px;
			}
			.check{
			height: 30rpx;
			width: 30rpx;
			border: 1rpx solid #00AEFF;
			border-radius: 50%;
			margin: 0 5px;	
			.yuan{
				width: 22rpx;
				height: 22rpx;
				background-color: #00AEFF;
				border-radius: 50%;
				margin: 4rpx;
				
			}
			}
			.xieyi{
				color:#00AEFF;
			}
			
		}
		
	}
}
</style>
